﻿@namespace AntDesign.Internal
@inherits AntDomComponentBase

@{
    string inlineFlexDisplay = InlineFlexMode ? "display: inline-flex;" : "";
}

@if (ChildContent != null)
{
    <div class="@ClassMapper.Class"
         style="@inlineFlexDisplay @Style"
         id="@Id"
         @ref="@Ref"
         @onclick="OnClickDiv"
         @onmouseenter="OnTriggerMouseEnter"
         @onmouseleave="OnTriggerMouseLeave"
         @oncontextmenu="OnTriggerContextmenu"
         @onfocusin="OnTriggerFocusIn"
         @onfocusout="OnTriggerFocusOut"
         @oncontextmenu:preventDefault>
        @ChildContent
    </div>
}

@if (Unbound != null)
{
    @Unbound(RefBack)
}

<CascadingValue Value="this" Name="Trigger" IsFixed="@true">
    <Overlay @ref="_overlay"
             HiddenMode="HiddenMode"
             OnShow="OnOverlayShow"
             OnHide="OnOverlayHide"
             OnOverlayMouseEnter="OnOverlayMouseEnter"
             OnOverlayMouseLeave="OnOverlayMouseLeave" />
</CascadingValue>